package Lab6;

import java.util.StringJoiner;

public class StringConverter {
    StringConverter(String[] args) {
        StringJoiner stringJoiner = new StringJoiner("*");
        for (String i : args) {
            stringJoiner.add(replace(i));
        }
        System.out.println("Output:" + stringJoiner);
    }

    public String replace(String str) {
        str = str.toUpperCase();
        str = str.replace('A', 'a');
        str = str.replace('E', 'e');
        str = str.replace('I', 'i');
        str = str.replace('O', 'o');
        str = str.replace('U', 'u');
        str = str.replace('Y', 'y');
        str = str.replaceAll("([^a-zA-Z])", "*");
        return str;
    }
}
